package com.worthtech.billportal.bean.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the acl_module table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="acl_module"
 */

public abstract class BaseModule  implements Serializable {

	public static String REF = "Module";
	public static String PROP_MODULE_NAME = "ModuleName";
	public static String PROP_NAV_ICON = "NavIcon";
	public static String PROP_PARENT_I_D = "ParentID";
	public static String PROP_ACTION_U_R_L = "ActionURL";
	public static String PROP_ORDERS = "Orders";
	public static String PROP_CHILD_I_DS = "ChildIDs";
	public static String PROP_MODULE_TYPE = "ModuleType";
	public static String PROP_PARENT_I_DS = "ParentIDs";
	public static String PROP_EXPLAINS = "Explains";
	public static String PROP_ID = "Id";
	public static String PROP_LEVEL = "Level";


	// constructors
	public BaseModule () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseModule (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseModule (
		java.lang.Integer id,
		java.lang.Integer parentID,
		java.lang.String moduleName) {

		this.setId(id);
		this.setParentID(parentID);
		this.setModuleName(moduleName);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer parentID;
	private java.lang.String parentIDs;
	private java.lang.String childIDs;
	private java.lang.String moduleName;
	private java.lang.String explains;
	private java.lang.Integer orders;
	private java.lang.String navIcon;
	private java.lang.Integer level;
	private java.lang.Byte moduleType;
	private java.lang.String actionURL;

	// collections
	private java.util.Set<com.worthtech.billportal.bean.Permission> permissions;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="ID"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: ParentID
	 */
	public java.lang.Integer getParentID () {
		return parentID;
	}

	/**
	 * Set the value related to the column: ParentID
	 * @param parentID the ParentID value
	 */
	public void setParentID (java.lang.Integer parentID) {
		this.parentID = parentID;
	}



	/**
	 * Return the value associated with the column: ParentIDs
	 */
	public java.lang.String getParentIDs () {
		return parentIDs;
	}

	/**
	 * Set the value related to the column: ParentIDs
	 * @param parentIDs the ParentIDs value
	 */
	public void setParentIDs (java.lang.String parentIDs) {
		this.parentIDs = parentIDs;
	}



	/**
	 * Return the value associated with the column: ChildIDs
	 */
	public java.lang.String getChildIDs () {
		return childIDs;
	}

	/**
	 * Set the value related to the column: ChildIDs
	 * @param childIDs the ChildIDs value
	 */
	public void setChildIDs (java.lang.String childIDs) {
		this.childIDs = childIDs;
	}



	/**
	 * Return the value associated with the column: ModuleName
	 */
	public java.lang.String getModuleName () {
		return moduleName;
	}

	/**
	 * Set the value related to the column: ModuleName
	 * @param moduleName the ModuleName value
	 */
	public void setModuleName (java.lang.String moduleName) {
		this.moduleName = moduleName;
	}



	/**
	 * Return the value associated with the column: Explains
	 */
	public java.lang.String getExplains () {
		return explains;
	}

	/**
	 * Set the value related to the column: Explains
	 * @param explains the Explains value
	 */
	public void setExplains (java.lang.String explains) {
		this.explains = explains;
	}



	/**
	 * Return the value associated with the column: Orders
	 */
	public java.lang.Integer getOrders () {
		return orders;
	}

	/**
	 * Set the value related to the column: Orders
	 * @param orders the Orders value
	 */
	public void setOrders (java.lang.Integer orders) {
		this.orders = orders;
	}



	/**
	 * Return the value associated with the column: NavIcon
	 */
	public java.lang.String getNavIcon () {
		return navIcon;
	}

	/**
	 * Set the value related to the column: NavIcon
	 * @param navIcon the NavIcon value
	 */
	public void setNavIcon (java.lang.String navIcon) {
		this.navIcon = navIcon;
	}



	/**
	 * Return the value associated with the column: Level
	 */
	public java.lang.Integer getLevel () {
		return level;
	}

	/**
	 * Set the value related to the column: Level
	 * @param level the Level value
	 */
	public void setLevel (java.lang.Integer level) {
		this.level = level;
	}



	/**
	 * Return the value associated with the column: ModuleType
	 */
	public java.lang.Byte getModuleType () {
		return moduleType;
	}

	/**
	 * Set the value related to the column: ModuleType
	 * @param moduleType the ModuleType value
	 */
	public void setModuleType (java.lang.Byte moduleType) {
		this.moduleType = moduleType;
	}



	/**
	 * Return the value associated with the column: ActionURL
	 */
	public java.lang.String getActionURL () {
		return actionURL;
	}

	/**
	 * Set the value related to the column: ActionURL
	 * @param actionURL the ActionURL value
	 */
	public void setActionURL (java.lang.String actionURL) {
		this.actionURL = actionURL;
	}



	/**
	 * Return the value associated with the column: permissions
	 */
	public java.util.Set<com.worthtech.billportal.bean.Permission> getPermissions () {
		return permissions;
	}

	/**
	 * Set the value related to the column: permissions
	 * @param permissions the permissions value
	 */
	public void setPermissions (java.util.Set<com.worthtech.billportal.bean.Permission> permissions) {
		this.permissions = permissions;
	}

	public void addTopermissions (com.worthtech.billportal.bean.Permission permission) {
		if (null == getPermissions()) setPermissions(new java.util.TreeSet<com.worthtech.billportal.bean.Permission>());
		getPermissions().add(permission);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.worthtech.billportal.bean.Module)) return false;
		else {
			com.worthtech.billportal.bean.Module module = (com.worthtech.billportal.bean.Module) obj;
			if (null == this.getId() || null == module.getId()) return false;
			else return (this.getId().equals(module.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}